package com.tengfei.common.utils.file;

import cn.hutool.core.map.MapBuilder;
import cn.hutool.core.map.MapUtil;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 媒体类型工具类
 *
 * @author tengfei
 */
public class MimeTypeUtils {
    public static final String IMAGE_PNG = "image/png";

    public static final String IMAGE_JPG = "image/jpg";

    public static final String IMAGE_JPEG = "image/jpeg";

    public static final String IMAGE_BMP = "image/bmp";

    public static final String IMAGE_GIF = "image/gif";

    public static final String[] IMAGE_EXTENSION = {"bmp", "gif", "jpg", "jpeg", "png"};

    public static final String[] FLASH_EXTENSION = {"swf", "flv"};

    public static final String[] MEDIA_EXTENSION = {"swf", "flv", "mp3", "wav", "wma", "wmv", "mid", "avi", "mpg",
            "asf", "rm", "rmvb"};

    public static final String[] VIDEO_TYPE = {"mp4", "avi", "mkv"};

    public static final String[][] RESOURCE_TYPE = {
            // 图片
            {"gif", "jpg", "jpeg", "png"},
            // 音频
            {"mp3"},
            // 文档
            {"doc", "docx", "xls", "xlsx", "ppt", "pptx", "pdf", "txt"},
            // 压缩文件
            {"rar", "zip", "7z"}};

    public static final Map<Integer, String> FILE_TYPE = MapUtil.builder(new HashMap<Integer, String>())
            .put(1, "图片")
            .put(2, "音频")
            .put(3, "文档")
            .put(4, "压缩文件")
            .put(5, "其它文件")
            .build();
}
